package com.lzx.applib.widget.image.imageview_attacher;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.widget.ImageView;

import com.lzx.applib.R;
import com.lzx.applib.utils.LogUtil;

public class ImageViewAttacherActivity extends Activity{

	private static final String TAG = "ImageViewAttacherActivi";
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		ImageView img = new ImageView(this);
		img.setImageResource(android.R.drawable.star_big_off);
		setContentView(img);
		
		ImageViewAttacher attacher = new ImageViewAttacher(img);
		attacher.rotateToLeft();
		attacher.attachClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				LogUtil.d(TAG, "onClick");
			}
		});
		attacher.attachLongClickListener(new OnLongClickListener() {

			@Override
			public boolean onLongClick(View v) {
				LogUtil.d(TAG, "onLongClick");
				return false;
			}
		});
	}
	
}
